package zmee.bid.formplugin;

import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.form.plugin.AbstractFormPlugin;

import java.util.*;
/**
* @author lijiawang
* @Date 2022/11/30 14:15
* @Description:项目预算项列表
*/
public class   PmasProjectbudgPlugin extends AbstractFormPlugin {
    @Override
    public void afterBindData(EventObject e) {
        Object obj = this.getView().getFormShowParameter().getCustomParam("list");
         if(obj!=null){
             this.getView().setVisible(false,"zmee_textfield2","zmee_textfield","zmee_textfield1","budgetitem","currency");
             List<Map<String, Object>> list =(List)obj;
            DynamicObjectCollection entity = this.getModel().getEntryEntity("treeentryentity");
            for (int i = 0; i < entity.size(); i++) {
                Map<String, Object> map = list.get(i);
                //项目金额
                this.getModel().setValue("budgetamount",map.get("budgetamount"),i);
                //项目余额
                this.getModel().setValue("budgetamoney",map.get("remainamt"),i);
                this.getModel().setValue("desc",map.get("remainamt"),i);
            }
        }
    }
}
